package net.dgg.zz.credential.certificateSpecialty.service;

import net.dgg.zz.credential.certificateSpecialty.dao.CertificateSpecialtyDao;
import net.dgg.zz.credential.certificateSpecialty.entity.CertificateSpecialty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CertificateSpecialtyService {

    @Autowired
    private CertificateSpecialtyDao certificateSpecialtyDao;

    public int insert(CertificateSpecialty certificateSpecialty) {
        return certificateSpecialtyDao.insert(certificateSpecialty);
    }

    public int deleteByCertificateId(Long certificateId) {
        return certificateSpecialtyDao.deleteByCertificateId(certificateId);
    }

    public List<Map> findByCondition(Map params) {
        return certificateSpecialtyDao.findByCondition(params);
    }

    public List<Long> findByByCertificateId(Long certificateId) {
        return certificateSpecialtyDao.findByByCertificateId(certificateId);
    }

    /**
     * 根据证书id查询证书绑定的证书基本类型
     *
     * @param id
     * @return
     */
    public List<CertificateSpecialty> findCertificateSpecialtyByCertificateId(Long id) {
        return certificateSpecialtyDao.findCertificateSpecialtyByCertificateId(id);
    }
}
